import 'package:flutter/material.dart';

class Widget_SimpleDialog_Page extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: Text("SimpleDialog"),
        ),
        body: RaisedButton(
          onPressed: () {
            showDialog(
              context: context,
              builder: (BuildContext context){
                return SimpleDialog(
                  title: Text("这是标题"),
                  titlePadding: EdgeInsets.only(bottom: 30.0, left: 10.0),
                  children: <Widget>[
                    SimpleDialogOption(
                      child: Text("这是第一行"),
                      onPressed: () {
                        print("点击了第一行");
                      },
                    ),
                    SimpleDialogOption(
                      child: Text("这是第二行"),
                      onPressed: () {
                        print("点击了第二行");
                      },
                    ),
                    Text("这是第三行文本")
                  ],
                  contentPadding: EdgeInsets.only(left: 40.0),

                );
              }
            );
          },
          child: Text("点击显示SimpleDialog"),
        ),
      ),
    );
  }

}

/**
 * 简单对话框，可以显示附加的提示和操作，通常配合SimpleDialogOption一起使用
    const SimpleDialog({
    Key key,
    this.title,//标题
    this.titlePadding = const EdgeInsets.fromLTRB(24.0, 24.0, 24.0, 0.0),//标题间距
    this.children,//要显示的内容
    this.contentPadding = const EdgeInsets.fromLTRB(0.0, 12.0, 0.0, 16.0),//内容间距
    this.semanticLabel,//
    this.shape,//
    })
 */
